package ZuoYe18;

import java.util.Scanner;

public class HomeWork7 {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int deleteIndex = scan.nextInt();
		int[] array = { 1, 2, 3, 4, 5, 6 };
		for (int i = deleteIndex + 1; i < array.length; i++) {
			array[i - 1] = array[i];
		}
		array[array.length - 1] = 0;
		for (int i : array) {
			System.out.print(i + " ");

		}
	}
}
